Repository navigation
Conversation
Codync runs coding agents as persistent bots you message from a phone, a desktop app or a terminal. Install Codync puts its host on the sandbox with Codync's own install script, runs it as a systemd user service with lingering, and Open in Codync opens Codync's terminal UI there over SSH, like Amp. Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a sandbox that is also a Codync cloud computer, codync-agent's host owns port 19222. The setup's host crash-looped on it, the health wait passed on the other host, and codync-tui showed "invalid token". The setup now installs the service on the next free port, codync-tui reads the port from the service, and the host counts as started only once it takes this user's token. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The setup installed the host only when the sandbox had none, so a sandbox with an old codync-host kept it: one test sandbox ran 2.24.0 while the release was 2.57.2. It now reads the latest release's version from its codync-host-compat.json and runs the install script for that release when the host is missing or older. A newer host, such as a dev build, stays, and so does any host when the version cannot be read. The link in /usr/local/bin is made only when nothing is there. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
2 issues found across 19 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src-tauri/src/ade/codync.rs">
<violation number="1" location="src-tauri/src/ade/codync.rs:68">
P2: This runs the install script from the `main` branch with no pinning or checksum, so any change to `main` runs on every sandbox during setup. Fetch a script tied to the resolved release version, or verify its checksum before running it.</violation>
</file>
<file name="docs/ades.md">
<violation number="1" location="docs/ades.md:328">
P2: The 20-second version-check limit in this Amp line is not in the code. `VERSION_SCRIPT` in `amp.rs` is `amp --version 2>/dev/null || true` with no timeout. Remove the clause, or add the timeout to the code.</violation>
</file>
Reply to a comment to ask cubic a question or push back. It learns from your replies.
View guided diff | Re-trigger cubic
| have="${have##* }" | ||
| latest="$(curl -fsSL --max-time 20 https://github.com/leepokai/Codync/releases/latest/download/codync-host-compat.json 2>/dev/null | sed -n 's/.*"version" *: *"\([0-9][0-9A-Za-z.+-]*\)".*/\1/p' || true)" | ||
| if [ -z "$have" ] || { [ -n "$latest" ] && older "$have" "$latest"; }; then | ||
| if ! curl -fsSL --max-time 60 https://raw.githubusercontent.com/leepokai/Codync/main/packaging/install.sh -o "$tmp/install.sh"; then |
There was a problem hiding this comment.
P2: This runs the install script from the main branch with no pinning or checksum, so any change to main runs on every sandbox during setup. Fetch a script tied to the resolved release version, or verify its checksum before running it.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src-tauri/src/ade/codync.rs, line 68:
<comment>This runs the install script from the `main` branch with no pinning or checksum, so any change to `main` runs on every sandbox during setup. Fetch a script tied to the resolved release version, or verify its checksum before running it.</comment>
<file context>
@@ -0,0 +1,288 @@
+have="${have##* }"
+latest="$(curl -fsSL --max-time 20 https://github.com/leepokai/Codync/releases/latest/download/codync-host-compat.json 2>/dev/null | sed -n 's/.*"version" *: *"\([0-9][0-9A-Za-z.+-]*\)".*/\1/p' || true)"
+if [ -z "$have" ] || { [ -n "$latest" ] && older "$have" "$latest"; }; then
+ if ! curl -fsSL --max-time 60 https://raw.githubusercontent.com/leepokai/Codync/main/packaging/install.sh -o "$tmp/install.sh"; then
+ echo "Could not download Codync's install script." >&2
+ exit 1
</file context>
There was a problem hiding this comment.
Not changed. This is the installer Codync publishes in its README (curl -fsSL https://raw.githubusercontent.com/leepokai/Codync/main/packaging/install.sh | sh), and it matches how the other ADEs here run their vendor's install script without pinning (Amp's https://ampcode.com/install.sh, Rex's install.sh). The script installs the release this setup read (CODYNC_VERSION=v<latest>) and checks the host's SHA-256.
|
|
||
| - When an SSH command cannot find `amp`, the command runs Amp's install script, `https://ampcode.com/install.sh`. It puts the latest Amp in `~/.amp/bin/amp`, checks its SHA-256 and links it as `~/.local/bin/amp`. Amp is one binary and needs no Node.js. InstaADE runs the script with `~/.local/bin` on its PATH, so the script changes no shell profile. An SSH command's PATH has neither folder, so InstaADE links Amp as `/usr/local/bin/amp`. An Amp the sandbox already has stays as it is. | ||
| - The download stops after 60 seconds and the install script after 5 minutes. When the download fails, the error ends with "Could not download Amp's install script." When the script fails or runs out of time, the error shows its last 3 lines and one line that says which. | ||
| - The version check stops after 20 seconds, the download after 60 seconds and the install script after 5 minutes. When the download fails, the error ends with "Could not download Amp's install script." When the script fails or runs out of time, the error shows its last 3 lines and one line that says which. |
There was a problem hiding this comment.
P2: The 20-second version-check limit in this Amp line is not in the code. VERSION_SCRIPT in amp.rs is amp --version 2>/dev/null || true with no timeout. Remove the clause, or add the timeout to the code.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At docs/ades.md, line 328:
<comment>The 20-second version-check limit in this Amp line is not in the code. `VERSION_SCRIPT` in `amp.rs` is `amp --version 2>/dev/null || true` with no timeout. Remove the clause, or add the timeout to the code.</comment>
<file context>
@@ -325,7 +325,7 @@ Amp is a coding agent whose CLI runs in a terminal. Like Herdr, it runs on the s
- When an SSH command cannot find `amp`, the command runs Amp's install script, `https://ampcode.com/install.sh`. It puts the latest Amp in `~/.amp/bin/amp`, checks its SHA-256 and links it as `~/.local/bin/amp`. Amp is one binary and needs no Node.js. InstaADE runs the script with `~/.local/bin` on its PATH, so the script changes no shell profile. An SSH command's PATH has neither folder, so InstaADE links Amp as `/usr/local/bin/amp`. An Amp the sandbox already has stays as it is.
-- The download stops after 60 seconds and the install script after 5 minutes. When the download fails, the error ends with "Could not download Amp's install script." When the script fails or runs out of time, the error shows its last 3 lines and one line that says which.
+- The version check stops after 20 seconds, the download after 60 seconds and the install script after 5 minutes. When the download fails, the error ends with "Could not download Amp's install script." When the script fails or runs out of time, the error shows its last 3 lines and one line that says which.
- Then it prints `amp --version`. When the command fails or prints no version, the sandbox does not get `amp` in its mark.
</file context>
| - The version check stops after 20 seconds, the download after 60 seconds and the install script after 5 minutes. When the download fails, the error ends with "Could not download Amp's install script." When the script fails or runs out of time, the error shows its last 3 lines and one line that says which. | |
| - The download stops after 60 seconds and the install script after 5 minutes. When the download fails, the error ends with "Could not download Amp's install script." When the script fails or runs out of time, the error shows its last 3 lines and one line that says which. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eff3c05bea
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if [ -x "$HOME/.local/bin/codync-host" ] && [ ! -e /usr/local/bin/codync-host ]; then | ||
| sudo -n ln -sfn "$HOME/.local/bin/codync-host" /usr/local/bin/codync-host |
There was a problem hiding this comment.
Use the selected host binary throughout setup and launch
When a sandbox already has an older executable at /usr/local/bin/codync-host (or a symlink to another installation), the updater writes the release to ~/.local/bin but this guard leaves the old executable on the SSH PATH. The generated codync-tui and final version check then resolve the old copy; an isolated run installed 2.57.2 yet successfully reported and launched 2.24.0. Subsequent Reconnects prefer the new local copy for have, so they skip updates while Open continues using the old host. Select one executable and consistently use it for the service, TUI and version checks without replacing an unrelated system copy.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in cca07ec. The setup picks one host, ~/.local/bin/codync-host or else the one on the PATH, and uses it for the service (installed again on its port when the unit runs another file), for codync-tui and for the version it prints. The /usr/local/bin link is still made only when nothing is there, so another copy is never replaced.
After an update to ~/.local/bin, an older codync-host earlier on the PATH kept running the service, the terminal UI and the version check. The setup now picks one host, the one in ~/.local/bin or else the one on the PATH, and uses it for all three; a service that runs another file is installed again on its port. codync-tui and the setup read the service's port from `systemctl --user cat`, so a custom XDG_CONFIG_HOME no longer hides it, and reading the host's version stops after 10 s. The docs say the setup updates an older host, and README says an idle sandbox can sleep and pause the bots. Amp's timeouts line, changed by mistake in the last commit, is as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src-tauri/src/ade/codync.rs">
<violation number="1" location="src-tauri/src/ade/codync.rs:298">
P2: This new test is Unix-only but runs unconditionally, so the Windows `cargo test` job cannot launch its `#!/bin/sh` fixture (and may not have `chmod`). Gate the test with `#[cfg(unix)]`, or replace the fixture with a platform-neutral test.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
| /// Runs the `codync-tui` the setup writes, with a fake `systemctl` and host: it takes the | ||
| /// port from the unit systemd reports and runs the host in ~/.local/bin, and falls back to | ||
| /// 19222 when there is no unit. | ||
| #[test] |
There was a problem hiding this comment.
P2: This new test is Unix-only but runs unconditionally, so the Windows cargo test job cannot launch its #!/bin/sh fixture (and may not have chmod). Gate the test with #[cfg(unix)], or replace the fixture with a platform-neutral test.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src-tauri/src/ade/codync.rs, line 298:
<comment>This new test is Unix-only but runs unconditionally, so the Windows `cargo test` job cannot launch its `#!/bin/sh` fixture (and may not have `chmod`). Gate the test with `#[cfg(unix)]`, or replace the fixture with a platform-neutral test.</comment>
<file context>
@@ -273,11 +292,57 @@ mod tests {
+ /// Runs the `codync-tui` the setup writes, with a fake `systemctl` and host: it takes the
+ /// port from the unit systemd reports and runs the host in ~/.local/bin, and falls back to
+ /// 19222 when there is no unit.
+ #[test]
+ fn the_terminal_ui_runs_the_setups_host_on_the_services_port() {
+ let tui = SETUP_SCRIPT
</file context>
What
Adds Codync as an ADE on macOS and Windows. Codync runs coding agents (Claude Code, Codex and others) as persistent bots you message from a phone, a desktop app or a terminal. Its host,
codync-host, runs on the sandbox. Like Amp, nothing of Codync runs on this computer: InstaADE installs the host on the sandbox and opens Codync's terminal UI there in the user's terminal over SSH. No app here gets an SSH token.codync-host-compat.json. When the sandbox has nocodync-host, or one older than that release, it runs Codync's install script for that release (packaging/install.sh --host-only), which puts the host in~/.local/bin, checks its SHA-256 and restarts a service that runs that file. A host as new as the release or newer (a dev build) stays, and so does any host when the version cannot be read. The setup then uses that one host (~/.local/bin, else the one on the PATH) for the service,codync-tuiand the version it prints, and links it as/usr/local/bin/codync-hostwhen nothing is there. It writes/usr/local/bin/codync-tui, since the SSH session runs one plain word, and turns on lingering.codync-hostservice yet,codync-host installwrites and starts a systemd user service from a login shell, so the service keeps the PATH where the agents are. With the service there, it only starts it, so Reconnect restarts bots at work only to update an older host.codync-agent). Then the service goes on the next free port,codync-tuireads the port from the service as systemd reports it, and the host counts as started only once it takes this user's token, not when anything answers on the port.Codync's install script failed.codync-host --version. Without a version, the sandbox does not getcodyncin its mark.ssh -t instabox-<name> codync-tui. It runs no setup on the sandbox.docs/ades.md,DEVELOPMENT.mdandCONTRIBUTING.mdlist Codync as a Terminal ADE.Install to Open
Installing Codync, then opening).ssh -t instabox-<name> codync-tui, and Codync's terminal UI on the sandbox shows its host's bot.The title bar of the Terminal window is cut off: the SSH user there is the sandbox's SSH token. The account in the popover's footer is blacked out.
How I checked
In InstaADE built from this branch at 0b76dcb (
bun tauri dev), before the last two commits, on macOS 27.0.1, signed in:Waking sandbox, thenInstalling Codync, then opening, then the sandbox running with Codync connected. It then opened Terminal withssh -t … codync-tui.codync-host2.24.0 it already had in~/.local/bin, which is why the setup now updates an older host.systemctl --user is-active codync-hostprintedactive, the service rancodync-host serve --port 19222, and the terminal UI rancodync-host tui --port 19222.Codync, with noinvalid token.ade::codync::tests::setup_updates_only_a_host_older_than_the_release: 2.24.0 and 2.9.0 are older than 2.57.2 and 2.10.0; 2.57.2 and 2.58.1 are not older than 2.57.2.ade::codync::tests::the_terminal_ui_runs_the_setups_host_on_the_services_portrunscodync-tuiwith a fakesystemctland host.sh -nandbash -npass on the setup.bun run typecheck,bun run test(247 passed).cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test: 986 passed.ade::paradev::tests::the_installed_paradev_cli_has_hosts_addfails on this Mac: it runs the Paradev CLI installed in/Applications, which this change does not touch.Not verified
~/.local/bin.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Adds Codync as a Terminal ADE, like Herdr and Amp: Codync's host runs on the sandbox, and Open in Codync opens its terminal UI in the user's terminal over SSH. Nothing of Codync runs on the computer, which needs only the OpenSSH client.
Behavior
codync-host-compat.jsonand installs or updatescodync-hostvia Codync's install script, then runs it as a systemd user service with lingering and writescodync-tuifor the SSH session.~/.local/binor the PATH), for the service,codync-tuiand the version print; a service that runs another file is installed again on its port, and any host at or after the release stays.codync-tuiand the setup read the port from the service as systemd reports it (systemctl --user cat), and the host counts as started only once it takes this user's token.ssh -t instabox-<name> codync-tuiwith no setup on the sandbox; reading the host's version stops after 10 s.docs/ades.md,DEVELOPMENT.mdandCONTRIBUTING.md.Written for commit cca07ec. Summary will update on new commits.